import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-qms/qms_lock_product/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getProductSn = (current, size, params) => {
  return request({
    url: `/api/mes-product/product/get-info?current=${current}&size=${size}`,
    method: 'post',
    data: params
  });
};

export const snLock = (data) => {
  return request({
    url: '/api/mes-qms/qms_lock_product/lock',
    method: 'post',
    data
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-qms/qms_lock_product/detail',
    method: 'get',
    params: {
      id
    }
  });
};

export const unLock = (data) => {
  return request({
    url: '/api/mes-qms/qms_lock_product/unlock',
    method: 'post',
    data
  });
};

export const batchUnLock = (data) => {
  return request({
    url: '/api/mes-qms/qms_lock_product/batch-unlock',
    method: 'post',
    data
  });
};
